package ejb.facades.extra;

import ejb.facades.AbstractFacade;
import entities.extra.Configuration;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * Trabalho PD - 2014/2015
 *
 * @author a21210380 a21210392
 */
@Stateless
public class ConfigurationFacade extends AbstractFacade<Configuration> implements ConfigurationFacadeLocal {

    @PersistenceContext(unitName = "Trabalho_PDPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    @Override
    public Configuration findSystemTime() {
        return em.createNamedQuery("Configuration.findSystemTime", Configuration.class).getSingleResult();
    }

    public ConfigurationFacade() {
        super(Configuration.class);
    }

}
